package book.LCCI;
/**
 * https://leetcode-cn.com/problems/is-unique-lcci/
 */
public class IsUniqueLCCI {
    // 暴力解法 时间复杂度 O(n*n)
    // 你强任你强我用双循环
    public boolean isUnique(String astr) {
        for (int i = 0; i < astr.length(); i++) {
            for (int j = i+1; j < astr.length(); j++) {
                if (astr.charAt(i) == astr.charAt(j)) {
                    return false;
                }
            }
        }
        return true;
    }
}
